package com.liusand.mapper;

import com.liusand.pojo.Dish;
import com.liusand.pojo.Flavors;
import com.liusand.vo.DishFlavorsVo;
import com.liusand.vo.DishVo;
import com.liusand.vo.FlavorsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Set;

/**
 * @author :liusha
 * packageName :com.liusand.mapper
 * fileName :DishMapper
 * creationTime :2022/11/23 20:46
 */
@Mapper
public interface DishMapper {
    Dish findDishById(@Param("id") String id);

    List<Flavors> findFlavorsByDishId(@Param("id") String id);

    List<DishVo> page(@Param("name") String name, @Param("start") Integer start, @Param("pageSize") Integer pageSize, @Param("type") Integer type);

    Long countPage(@Param("name") String name, @Param("type") Integer type);

    List<DishFlavorsVo> list(@Param("id") String id);

    Integer saveFlavors(List<Flavors> flavorsList);

    Integer saveDish(Dish dish);

    Integer updateDish(@Param("dish") Dish dish);

    Integer deleteFlavorsByDishId(@Param("dishIds") List<String> dishIds);

    Integer deleteDish(@Param("ids") List<String> ids);

    Integer updateStatus(@Param("status") Integer status, @Param("ids") List<String> ids);

    List<Dish> findDishByCategoryIdAndStatus(@Param("categoryId") String categoryId, @Param("status") Integer status);

    List<FlavorsVo> findFlavorsByDishIds(@Param("dishIds") Set<String> dishIds);
}
